/**
 * Created by jiangtao on 16/4/30.
 */
(function(){
    var dom = $('body');
    //table联动
    (function(){

        $('*[data-toggle="tab"]').hover(selectTable,outFun);
        function selectTable(){
            var self = this;
            $('*[data-toggle="tab"]').each(function(index,dom){
                if(self == dom){
                    $(dom).addClass('active');
                    $(dom).find('.scoend-list').addClass('show');
                } else {
                    $(dom).removeClass('active');
                    $(dom).find('.scoend-list').removeClass('show');
                };
            });
        };
        function outFun(){
            $(this).find('.scoend-list').removeClass('show');
        };
        $(window).on('resize',tableLine);
        function tableLine(){
            var winW = $(window).width();
            var boxW = 1200;
            var currentWidth = (winW >= boxW ? winW : boxW);
            var left = (boxW - currentWidth) / 2;
            $('.bule-window-line').css({
                width:winW +'px',
                left:left + 'px'
            });
        }
        tableLine();
    })();


})();